<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>易销后台管理服务平台</title>
    <LINK rel="stylesheet" type="text/css" href="style/pub/publicStylePC.css"/>
    <LINK rel="stylesheet" type="text/css" href="style/main.css"/>
    <link rel="stylesheet" type="text/css" href="themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="themes/icon.css">
    <!--[if lte IE 8]>
    <link rel="stylesheet" type="text/css" href="style/main_ie8.css"/>
    <![endif]-->
</head>
<body>
<div class="topBar">
    <div class="insideWidth t1">
            <div class="tips c3">客服电话：<strong>4006076517</strong>&nbsp;&nbsp;&nbsp;&nbsp;工作时间：<strong>9:30-22:00</strong></div>
<!--        <div class="tips c3"><strong>想赚钱？</strong>用易销接口平台，你的网站也可以成为<strong>线上营业厅</strong></div>-->
        <div class="positionBlock t1">
            <div class="topPart user c3">欢迎，<span id="myUsername">用户</span></div>
           <!--  <div id="account"  class="topPart account c2">余额<span id="myAccount" class="c4" onclick="loadAmount();" title="点击以刷新当前余额"></span></div> -->
<!--            <div class="topPart"><span id="editPasword"  onclick="resetPassword();" title="点击修改密码">修改密码</span></div>-->
            <!-- <div class="topPart"><a id="editPasword" href="javascript:resetPassword();" title="点击修改密码">修改密码</a></div> -->
            <div class="topPart exit"><a id="logoutBtn" href="javascript:void(0);" >退出登录</a></div>
        </div>
    </div>
</div>
<div class="mainBar">
    <div class="insideWidth">
        <h1 class="t5 c6">易销后台管理服务平台</h1>
        <img src="style/images/logo.png" id="logo" alt="上海易销" title="上海易销科技有限公司"/>
        <div class="nav t3 c6" id="nav">
            <a class="template" href="{#href#}" title="{#title#}" ship="{#ship#}">{#txt#}</a>
        </div>
    </div>
</div>
<div class="mainContent">
    <div class="insideWidth">
        <ul class="menu" id="menu">
            <li class="level1 t2 template">
                <a href="{#href2#}" class="txt" title="{#title2#}" ship="{#ship#}">{#txt2#}</a>
                <div class="level2">
                    <a href="{#href3#}" class="txt template" title="{#title3#}">{#txt3#}</a>
                </div>
            </li>
        </ul>
        <div class="content">
            <div class="menuItem">
                <ul id="menuItemList" class="t2 c2">
                    <li title="{#title#}" key="{#key#}" class="temp template"><span class="txt">{#txt#}</span><span
                            class="close">&times;</span></li>
                </ul>
            </div>
            <div id="moveButton" class="t2 c5">
                <span class="buttonLeft">&lt;</span>
                <span class="buttonRight">&gt;</span>
            </div>
            <div id="frameContent"></div>
        </div>
    </div>
</div>
<div id="backMask"></div>
<div id="dialog">
    <!-- 错误信息对话框样例 -->
    <div name="d_message" class="inside">
        <div class="dTitle">
            <h3 class="t3 c3">系统提示信息</h3>
            <span class="close">&times;</span>
        </div>
        <div class="dContent">
            <p class="t2 c2">
                这里显示需要提示<strong>的信息内</strong>容这里显示需要提示的信息内容<br/>
                这里显示需要提示的信息内容这里显示需要提示的信息内容
            </p>
        </div>
        <div class="dButtonBar">
            <div class="buttonBlock unuse close">取 消</div>
            <div class="buttonBlock use">确 定</div>
        </div>
    </div>
</div>
<!-- 弹出窗口定义 修改密码 -->
<div id="passwordEdit" class="easyui-dialog" title="修改密码" data-options="iconCls:'icon-save'" closed="true" style="width:350px;height:250px;padding:20px;align-content: true">
	  <form id="passwordFm" method="post">
			<table class="viewTable" cellpadding="5">
				<tr>
					<td width="25%">原始密码：</td>
					<td>
					    <input class="easyui-validatebox" type="password" id="password" name="password" maxlength="20" data-options="required:true" title="原始密码"/>
					</td>
				</tr>
				<tr></tr><tr></tr>
				<tr>
					<td width="25%">新密码：</td>
					<td>
						<input class="easyui-validatebox" type="password" id="rePassword" name="rePassword" maxlength="20" data-options="required:true,validType:'length[0,20]'"/>
					</td>
				</tr>
				<tr></tr><tr></tr>
				<tr>
					<td width="25%">确认密码：</td>
					<td>
						<input class="easyui-validatebox" type="password" id="rePassword2" name="rePassword2" maxlength="20" data-options="required:true,validType:'length[0,20]'"/>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
					   <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="updatePassword()">确定</a>
					   <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#passwordEdit').dialog('close');$('#passwordFm').form('reset');">取消</a>
					 </td>
				</tr>
			</table>
	</form>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="js/pub/relax_function.js"></script>
<script type="text/javascript" src="js/pub/relax_interface2.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/comm_check.js"></script>
 <script type="text/javascript">
    $(function () {
        loadAmount();
    });
    
    function loadAmount(){
        var url = ctx + "/user/getUserInfo.svc";
		var params = 'params={}';
		$.post(url, params, function(data, status) {
			console.log(data);
			if (data.succ) {
					$("#myUsername").html(data.result.realName);
			} 
		});
    }
    function resetPassword(){
       $('#passwordEdit').dialog('open');
    }
    
     /**
    * 修改密码
    */
   function updatePassword(){
      var password =  $("#passwordFm #password").val();
	  var rePassword =  $("#passwordFm #rePassword").val();
	  var rePassword2 =  $("#passwordFm #rePassword2").val();
	  if(isNull(password)){
	      alert("请输入原始密码！");
		  return ;
	  }
	  if(isNull(rePassword)){
	      alert("请输入新密码！");
		  return ;
	  }
	  if(isNull(rePassword2)){
	      alert("请输入确认密码！");
		  return ;
	  }
	  if(rePassword != rePassword2){
	      alert("新密码与确认密码必须相同！");
		  return ;
	  }
	  var url = ctx + "/user/updateInfo.svc";
	  var params = 'params={"password":"' + password + '", "rePassword":"' + rePassword + '"}';
	  $.post(url, params, function (data, status) {
		    var obj=eval("["+data.rspData+"]"); 
		    var res = obj[0];
		    if (res.status == '1') {
		         $('#passwordEdit').dialog('close');
		         $.messager.alert("提示信息", res.info, "info");
		    }else{
		        $.messager.alert("提示信息", res.info, "info");
		    }
	});
} 
</script>
</body>
</html>